<html>
    <head>

    </head>
    <body>



<table>
    <thead>
        <tr>
            <th>接口</th>
            <th>功能</th>
            <th>分类</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>TaskExecutor()</td>
            <td rowspan="2">构造和析构函数</td>
            <td rowspan="6">NA</td>
        </tr>
        <tr>
            <td>~TaskExecutor()</td>
        </tr>
        <tr>
            <td>virtual void Destory()</td>
            <td>用于释放任务执行器所占用的线程资源</td>
        </tr>
        <tr>
            <td>virtual int32_t GetTid(TaskType type)</td>
            <td>用于获取执行指定类型任务的线程ID</td>
        </tr>
        <tr>
            <td>virtual uint32_t GetTotalTaskNum(TaskType type)</td>
            <td>用于获取执行指定类型任务的线程任务队列中的任务数量</td>
        </tr>
        <tr>
            <td>virtual bool WillRunOnCurrentThread(TaskType type) const = 0</td>
            <td>用于判断执行抛任务的线程与任务类型是否一致（上述以Post开始的接口）</td>
        </tr>
        <tr>
            <td>bool PostTaskAndWait(CancelableTask&& task, TaskType type, std::chrono::milliseconds timeoutMs = 0ms) const</td>
            <td>用于抛同步任务的底层接口，所有抛同步任务的接口均间接调用此接口</td>
            <td rowspan="6">同步任务相关接口</td>
        </tr>
        <tr>
            <td>bool PostSyncTask(Task&& task, TaskType type) const</td>
            <td rowspan="4">将同步任务抛到指定线程</td>
        </tr>
        <tr>
            <td>bool PostSyncTask(const Task& task, TaskType type) const</td>
        </tr>
        <tr>
            <td>bool PostSyncTask(CancelableTask&& task, TaskType type) const</td>
        </tr>
        <tr>
            <td>bool PostSyncTask(const CancelableTask& task, TaskType type) const</td>
        </tr>
        <tr>
            <td>bool PostSyncTaskTimeout(const Task& task, TaskType type, uint32_t timeoutMs) const</td>
            <td>将同步任务抛到指定线程并设置超时时间,若超过设定时间任务还未执行,则取消任务</td>
        </tr>
        <tr>
            <td>virtual bool OnPostTask(Task&& task, TaskType type, uint32_t delayTime) const = 0</td>
            <td>用于抛异步任务的底层接口，所有抛异步任务的接口均间接调用此接口</td>
            <td rowspan="8">异步任务相关接口</td>
        </tr>
        <tr>
            <td>bool PostDelayedTask(Task&& task, TaskType type, uint32_t delayTime) const</td>
            <td rowspan="2">将异步延时任务抛到指定线程</td>
        </tr>
        <tr>
            <td>bool PostDelayedTask(const Task& task, TaskType type, uint32_t delayTime) const</td>
        </tr>
        <tr>
            <td>bool PostTask(Task&& task, TaskType type) const</td>
            <td rowspan="2">将延时为0的异步任务抛到指定线程</td>
        </tr>
        <tr>
            <td>bool PostTask(const Task& task, TaskType type) const</td>
        </tr>
        <tr>
            <td>virtual Task WrapTaskWithTraceId(Task&& task, int32_t id) const = 0</td>
            <td>将TraceId与所要执行的任务打包到一起</td>
        </tr>
        <tr>
            <td>bool PostTaskWithTraceId(Task&& task, TaskType type, int32_t id) const</td>
            <td rowspan="2">将带有TraceId的延时为0的异步任务抛到指定线程，TraceId用于日志中</td>
        </tr>
        <tr>
            <td>bool PostTaskWithTraceId(const Task& task, TaskType type, int32_t id) const</td>
        </tr>
        <tr>
            <td>virtual void AddTaskObserver(Task&& callback) = 0</td>
            <td rowspan="2">添加或移除可多次执行的任务</td>
            <td rowspan="2">可多次执行的任务相关接口</td>
        </tr>
        <tr>
            <td>virtual void RemoveTaskObserver() = 0</td>
        </tr>
    </tbody>
</table>




    </body>
</html>